<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="shortcut icon" href="/assets/img/efo-favicon.png"/>
    <link rel="stylesheet" href="/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/fileinput.min.css">
    <link rel="stylesheet" href="/assets/css/glyphicons.css">
    <script src="/assets/js/popper.min.js"></script>
    <script src="/assets/js/jquery-3.3.1.js"></script>
    <script src="/assets/js/bootstrap.min.js"></script>
    <script src="/assets/js/layer.js"></script>
    <script src="/assets/js/vue.js"></script>
    <script src="/assets/js/piexif.min.js"></script>
    <script src="/assets/js/sortable.min.js"></script>
    <script src="/assets/js/purify.min.js"></script>
    <script src="/assets/js/fileinput.min.js"></script>
    <script src="/assets/js/theme.js"></script>
    <script src="/assets/js/utils.js"></script>
    <link rel="stylesheet" href="/assets/css/style.css"/>
    <title>首页</title>
</head>
<body id="particles-js">
<nav class="navbar navbar-expand-sm bg-dark navbar-dark navbar-toggler fixed-top">
    <img src="/assets/img/efo-favicon.png" class="navbar-brand" style="width: 2rem;height: 2.5rem;"/>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="collapsibleNavbar">
        <ul class="navbar-nav nav nav-pills">
            <li class="nav-item">
                <a class="nav-link active" data-toggle="pill" href="#resource-tab">资源列表</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" data-toggle="pill" href="#uploaded-tab">我的上传</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" data-toggle="pill" href="#downloaded-tab">我的下载</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" data-toggle="pill" href="#bio-tab">我的资料</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="upload" target="_blank">文件上传</a>
            </li>
        </ul>
    </div>
    <div class="form-inline w-50">
        <input class="form-control border-dark bg-dark text-white form-control-sm w-100" type="search"
               placeholder="搜索" id="search"/>
    </div>
</nav>
<br/><br/><br/>
<div class="container" id="index">
    <div class="row justify-content-center">
        <div class="col-sm-12 col-10 tab-content">
            <!--资源列表-->
            <div class="tab-pane active" id="resource-tab">
                <div class="row content-box rounded">
                    <div class="col-sm-2 col-4">
                        <br/>
                        <select class="form-control content-filter" id="category" title="查找指定分类文件"
                                data-toggle="tooltip">
                            <option value="0">全部</option>
                        </select>
                        <br/>
                    </div>
                    <div class="col-sm-2 col-4">
                        <br/>
                        <select class="form-control content-filter" id="order-by" title="排序方法" data-toggle="tooltip">
                            <option value="id">时间</option>
                            <option value="download_times">热度</option>
                            <option value="size">大小</option>
                        </select>
                        <br/>
                    </div>
                    <div class="col-sm-2 col-4">
                        <br/>
                        <select class="form-control content-filter" id="order-way" title="排序方式" data-toggle="tooltip">
                            <option value="desc">降序</option>
                            <option value="asc">升序</option>
                        </select>
                        <br/>
                    </div>
                </div>
                <br/>
                <div id="resources-content"></div>
                <button class="btn btn-link btn-block btn-lg" onclick="offset += 1;getPage();"><b><i
                        class="glyphicon glyphicon-arrow-down"></i> 获取更多</b></button>
                <br/><br/>
            </div>
            <!--我的上传-->
            <div class="tab-pane" id="uploaded-tab">
                <div id="uploaded-content"></div>
                <button class="btn btn-link btn-block btn-lg" onclick="offset += 1;getPage();"><b><i
                        class="glyphicon glyphicon-arrow-down"></i> 获取更多</b></button>
                <br/><br/>
            </div>
            <div class="tab-pane" id="downloaded-tab">
                <div id="downloaded-content"></div>
                <button class="btn btn-link btn-block btn-lg" onclick="offset += 1;getPage();"><b><i
                        class="glyphicon glyphicon-arrow-down"></i> 获取更多</b></button>
                <br/><br/>
            </div>
            <!--我的资料-->
            <div class="tab-pane text-left" id="bio-tab">
                <!--权限和登陆信息-->
                <div class="row content-box rounded">
                    <div class="col-sm-1 col-1 col-md-1"></div>
                    <div class="col-sm-11 col-11 col-md-6">
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right">
                                <span class="text-right">权限：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <div v-if="permission>1">
                                    <a href="admin" target="_blank">管理员</a>
                                </div>
                                <div v-else>
                                    <span class="text-left">普通用户</span>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right">
                                <span class="text-right">登陆时间：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <span class="text-left">{{loginTime}}</span>
                            </div>
                        </div>
                        <br/>
                    </div>
                </div>
                <br/>
                <!--基本信息-->
                <div class="row content-box rounded">
                    <div class="col-sm-1 col-1 col-md-1"></div>
                    <div class="col-sm-11 col-11 col-md-6">
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right">
                                <img onclick="showAvatarModal();" src="/assets/img/default-user.jpg" id="avatar"
                                     class="rounded-circle avatar"/>
                            </div>
                            <div class="col-sm-6 col-7 text-left padding-top-3">
                                <h3>{{username}}</h3>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right padding-top-1">
                                <span class="text-right">真实姓名：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <input placeholder="我的真实姓名" id="real-name" type="text" class="form-control"/>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right padding-top-1">
                                <span class="text-right">邮箱：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <input placeholder="我的邮箱" id="email" type="email" class="form-control email"/>
                                <label class="form-check-label text-danger">{{emailErrorTip}}</label>
                            </div>
                        </div>
                        <div class="row verify-code-div" style="display: none;">
                            <div class="col-sm-8 offset-sm-1 offset-2 col-10 row">
                                <div class="col-sm-7 col-6 col-md-7">
                                    <input type="number" id="email-verify-code" maxlength="6"
                                           class="form-control email-verify-code"
                                           placeholder="收到的6位验证码"/>
                                    <label class="form-check-label text-danger">{{emailVerifyStatus}}</label>
                                </div>
                                <div class="col-sm-4 col-md-54 col-5 offset-1 text-right padding-0">
                                    <button class="btn btn-outline-info sendVerifyCode btn-block">发送验证码</button>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-1 col-2"></div>
                            <div class="col-sm-8 col-10 text-right">
                                <button class="btn btn-primary btn-block" onclick="saveInfo();">保存</button>
                            </div>
                        </div>
                        <br/>
                    </div>
                </div>
                <br/>
                <!--修改密码-->
                <div class="row content-box rounded">
                    <div class="col-sm-1 col-1 col-md-1"></div>
                    <div class="col-sm-11 col-11 col-md-6">
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right padding-top-1">
                                <span class="text-right">旧密码：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <input placeholder="旧密码" id="old-password" type="password" class="form-control"/>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right padding-top-1">
                                <span class="text-right">新密码：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <input placeholder="新密码" id="new-password" type="password"
                                       class="password form-control"/>
                                <label class="form-check-label text-danger">{{passwordVerify}}</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-5 text-right padding-top-1">
                                <span class="text-right">确认新密码：</span>
                            </div>
                            <div class="col-sm-6 col-7 text-left">
                                <input placeholder="确认新密码" id="confirm-new-password" type="password"
                                       class="form-control confirm-password"/>
                                <label class="form-check-label text-danger">{{passwordConfirm}}</label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-1 col-2"></div>
                            <div class="col-sm-8 col-10 text-right">
                                <button class="btn btn-warning btn-block" onclick="updatePassword();">修改密码</button>
                                <br/>
                                <a href="signin.html#reset" class="btn btn-block btn-danger" target="_blank">忘记密码</a>
                            </div>
                        </div>
                        <br/>
                    </div>
                </div>
                <div class="row"><br/></div>
            </div>
        </div>
    </div>
    <div class="row text-center" id="footer"></div>
</div>

<!--文本编辑模态框-->
<div class="modal fade" id="edit-file-modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">文件信息编辑</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-9">
                        <input type="hidden" id="edit-file-id" value="0">
                        <input type="text" class="form-control" title="文件名" placeholder="文件名" data-toggle="tooltip"
                               id="edit-file-name"/>
                    </div>
                    <div class="col-sm-3">
                        <select class="form-control" id="edit-file-category" title="文件分类" data-toggle="tooltip">
                            <option value="0">未分类</option>
                        </select>
                    </div>
                </div>
                <br/>
                <div class="row">
                    <div class="col-sm-12 col-12">
                        <input type="text" class="form-control" id="edit-file-tag" data-toggle="tooltip"
                               placeholder="文件标签，多个文件标签使用空格分隔" title="文件标签，多个文件标签使用空格分隔">
                    </div>
                </div>
                <br>
                <div class="row">
                    <div class="col-12 col-sm-12">
                        <textarea class="form-control" id="edit-file-description" placeholder="文件描述" title="文件描述"
                                  data-toggle="tooltip"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="saveFileInfo();">保存</button>
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            </div>

        </div>
    </div>
</div>
<script src="/assets/js/particles.js"></script>
<script src="/assets/js/default.js"></script>
<script src="/assets/js/index.js"></script>
</body>
</html>